package cn.imnaer.service.rpc.scenic.dao;

import java.util.ArrayList;
import java.util.List;

import cn.imnaer.service.persistence.model.UserScenicInfo;
import cn.imnaer.service.rest.view.model.Place;

public class UserScenicComponentRpcApiImpl {
	private UserScenicRepository userScenicRepository = new UserScenicRepository();

	public List<Place> search(String keywords,String userId) {
		List<UserScenicInfo> userScenics = userScenicRepository.search(keywords,userId);
		List<Place> places = new ArrayList<>();
		for (UserScenicInfo userScenicInfo : userScenics) {
			Place place = new Place();
			place.setAttribute(userScenicInfo);
			places.add(place);
		}

		return places;
	}
   
}
